package service.customer.impl;

import dao.customer.CustomerDao;
import dao.customer.impl.*;
import pojo.*;
import service.customer.ServiceCustomer;
import util.PageSupport;

import java.util.List;

/**
 * 作者：孩子他爹  日期2019/4/10
 * 顾客操作实现
 */
public class ServiceCustomerImpl implements ServiceCustomer {

    private CustomerDao cd;     //顾客操作对象

    public ServiceCustomerImpl() {
        cd=new CustomerDaoImpl();
    }

    @Override
    public int addCustomerDao(Customer cto) {
        return cd.addCustomerDao(cto);
    }

    @Override
    public int customerLoginNameExists(String name) {
        return cd.customerLoginNameExists(name);
    }

    @Override
    public Customer customerExists(String name, String pwd) {
        return cd.customerExists(name,pwd);
    }

    @Override
    public List<BigClass> getBigClass() {
        return cd.getBigClass();
    }

    @Override
    public List<Smallclass> getSmallclassById(long smallBigId) {
        return cd.getSmallclassById(smallBigId);
    }

    @Override
    public List<ShoppingRecord> getShoppingRecordByCusId(long id, long scStatus) {
        return cd.getShoppingRecordByCusId(id,scStatus);
    }

    @Override
    public List<ShoppingRecord> getShoppingRecordByCusId(long id, long scStatus, PageSupport ps) {
        return cd.getShoppingRecordByCusId(id,scStatus,ps);
    }

    @Override
    public int deleteShoppingRecord(long srId) {
        return cd.deleteShoppingRecord(srId);
    }

    @Override
    public int updateShop(long srId,int number) {
        return cd.updateShop(srId,number);
    }

    @Override
    public int getShopCount(long srId,long statuc) {
        return cd.getShopCount(srId,statuc);
    }

    @Override
    public int addShopRec(List<ShoppingRecord> lsr, String address) {
        return cd.addShopRec(lsr,address);
    }

    @Override
    public List<CusOrderse> getOrderseList(Long cid,int index,int row) {
        return cd.getOrderseList(cid,index,row);
    }

    @Override
    public int getOrderseCount(Long cid) {
        return cd.getOrderseCount(cid);
    }

    @Override
    public int addShopGods(Shoppingcar shop) {
        return cd.addShopGods(shop);
    }

    @Override
    public Customer getCusByCodeName(String code, String name) {
        return cd.getCusByCodeName(code,name);
    }

    @Override
    public int updataCuPwd(Long id, String pwd) {
        return cd.updataCuPwd(id,pwd);
    }

    @Override
    public int updateOrd(Long id) {
        return cd.updateOrd(id);
    }
}
